import request from '@/utils/request'

export function list(query) {
  return request({
    url: '/admin/v1/sys/config/list',
    method: 'get',
    params: query
  })
}

export function detail(id) {
  return request({
    url: `/admin/v1/sys/config/${id}`,
    method: 'get'
  })
}

export function add(data) {
  return request({
    url: '/admin/v1/sys/config/add',
    method: 'post',
    data
  })
}

export function getBasicSetting() {
  return request({
    url: `/admin/v1/sys/config/getBasicSetting`,
    method: 'get'
  })
}

export function saveBasicSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveBasicSetting',
    method: 'post',
    data
  })
}

export function getKdniaoSetting() {
  return request({
    url: `/admin/v1/sys/config/getKdniaoSetting`,
    method: 'get'
  })
}

export function saveKdniaoSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveKdniaoSetting',
    method: 'post',
    data
  })
}

export function getAgentSetting() {
  return request({
    url: `/admin/v1/sys/config/getAgentSetting`,
    method: 'get'
  })
}

export function rechargeBalance(params) {
  return request({
    url: `/admin/v1/sys/config/recharge`,
    method: 'get',
    params
  })
}

export function subtractBalance(params) {
  return request({
    url: `/admin/v1/sys/config/subtract`,
    method: 'get',
    params
  })
}

export function saveAgentSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveAgentSetting',
    method: 'post',
    data
  })
}

export function getSmsBaoSetting() {
  return request({
    url: `/admin/v1/sys/config/getSmsBaoSetting`,
    method: 'get'
  })
}

export function saveSmsBaoSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveSmsBaoSetting',
    method: 'post',
    data
  })
}

export function getsTopUpChannelsSetting() {
  return request({
    url: `/admin/v1/sys/config/getsTopUpChannelsSetting`,
    method: 'get'
  })
}

export function saveTopUpChannelsSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveTopUpChannelsSetting',
    method: 'post',
    data
  })
}

export function getServiceAgreementSetting() {
  return request({
    url: `/admin/v1/sys/config/getServiceAgreementSetting`,
    method: 'get'
  })
}

export function saveServiceAgreementSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveServiceAgreementSetting',
    method: 'post',
    data
  })
}

export function getPrivacyAgreementSetting() {
  return request({
    url: `/admin/v1/sys/config/getPrivacyAgreementSetting`,
    method: 'get'
  })
}

export function getGrantSetting() {
  return request({
    url: `/admin/v1/sys/config/getGrantSetting`,
    method: 'get'
  })
}

export function savePrivacyAgreementSetting(data) {
  return request({
    url: '/admin/v1/sys/config/savePrivacyAgreementSetting',
    method: 'post',
    data
  })
}

export function saveGrantSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveGrantSetting',
    method: 'post',
    data
  })
}

export function getEducationalFundSetting() {
  return request({
    url: `/admin/v1/sys/config/getEducationalFundSetting`,
    method: 'get'
  })
}

export function saveEducationalFundSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveEducationalFundSetting',
    method: 'post',
    data
  })
}

export function getGeneralSetting() {
  return request({
    url: `/admin/v1/sys/config/getGeneralSetting`,
    method: 'get'
  })
}

export function saveGeneralSetting(data) {
  return request({
    url: '/admin/v1/sys/config/saveGeneralSetting',
    method: 'post',
    data
  })
}

export function update(data) {
  return request({
    url: '/admin/v1/sys/config/update',
    method: 'put',
    data
  })
}

export function del(data) {
  return request({
    url: '/admin/v1/sys/config/delete',
    method: 'delete',
    data
  })
}
